import request from '@/utils/request'

export default {
  page(current, limit, query) {
    return request({
      url: `/edu/course/page/${current}/${limit}`,
      method: 'post',
      data: query
    })
  },
  deleteById(id) {
    return request({
      url: `/edu/course/delete/${id}`,
      method: 'post'
    })
  },

  addCourseInfo(courseInfo) {
    return request({
      url: '/edu/course/addCourseInfo',
      method: 'post',
      data: courseInfo
    })
  },
  getCourseInfo(courseId) {
    return request({
      url: `/edu/course/getCourseInfo/${courseId}`,
      method: 'get'
    })
  },
  updateCourseInfo(courseInfo) {
    return request({
      url: '/edu/course/updateCourseInfo',
      method: 'post',
      data: courseInfo
    })
  },
  prePublishCourse(courseId) {
    return request({
      url: `/edu/course/prepublish/${courseId}`,
      method: 'get',
    })
  },
  publishCourse(courseId) {
    return request({
      url: `/edu/course/publish/${courseId}`,
      method: 'post',
    })
  },
}
